#include "iConfig.hpp"

#include <glf/core/spinLock.h> 
 
#if __APPLE__
	#include "synchronization_posix_.hpp"
#else
	#include GLFi_HEADER_API(synchronization, GLF_API_THREAD)
#endif


namespace glf
{

SpinLock::SpinLock()
	: m(GLF_NEW_IMPL_NO_ARGS())
{
	GLF_CHECK_IMPL_SIZE();
}

SpinLock::~SpinLock()
{
	GLF_DELETE_IMPL();
}

void SpinLock::Lock()
{
	m.Lock();
}

bool SpinLock::TryLock()
{
	return m.TryLock();
}

void SpinLock::Unlock()
{
	m.Unlock();
}

} //namespace glf
